package com.example.gravitysituation;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;

public class CircuitSelection extends Activity {

	public Integer selectedCircuit;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_circuit_selection);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.circuit_selection, menu);
		return true;
	}
	
	// Get user input and pass on selected information to simulation
	public void startCircuit(View v){
		switch(v.getId()){
			case R.id.button1:
				selectedCircuit = 1;
				break;
			case R.id.button2:
				selectedCircuit = 2;
				break;
			case R.id.button3:
				selectedCircuit = 3;
				break;
			case R.id.button4:
				selectedCircuit = 4;
				break;
		}
		Intent i = new Intent(getApplicationContext(), CircuitSimulation.class);
		i.putExtra("CircuitNum", selectedCircuit);
		startActivity(i);
	}
	
	// Return to Circuit main
	public void circuitMain(View view){
		Intent intent = new Intent( this, CircuitMain.class);
		startActivity(intent);
	}

	// Return to Circuit main
	public void mainMenu(View view){
		Intent intent = new Intent( this, MainActivity.class);
		startActivity(intent);
	}
}
